package com.yuexi.app.coverter;

import com.yuexi.bill.cqe.BillQuery;
import com.yuexi.bill.dto.BillDTO;
import com.yuexi.domain.bill.bo.BillBO;
import com.yuexi.domain.bill.bo.BillQueryBO;
import com.yuexi.domain.syscode.bo.SysCodeQueryBO;
import com.yuexi.domain.syscode.bo.SysCodeResultBO;
import com.yuexi.domain.table.bo.TableBO;
import com.yuexi.syscode.cqe.SysCodeQuery;
import com.yuexi.syscode.dto.SysCodeDTO;
import com.yuexi.table.dto.TableDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface Converter {

    Converter INSTANCE = Mappers.getMapper(Converter.class);

    SysCodeQueryBO toSysCodeQueryBO(SysCodeQuery sysCodeQuery);

    List<SysCodeDTO> toSysCodeDTOList(List<SysCodeResultBO> query);

    SysCodeDTO toSysCodeDTO(SysCodeResultBO one);

    TableDTO toTableDTO(TableBO tableBO);

    BillQueryBO toBillQueryBO(BillQuery query);

    @Mapping(target = "areaType", ignore = true)
    BillDTO toBillDTO(BillBO billBO);
}
